<?php
class content{
	public function init($params=array()){
		$this->db=$this->yum->library('mysql');
		$this->prefix=$this->yum->vars('app','prefix');
	}
    public function GContent($params=array()){
    	return $this->db->select($this->prefix.'content AS A',$params);
    }
    public function GContentFull($params=array()){
    	$table=$this->prefix.'content AS A';
    	$table.=' LEFT JOIN '.$this->prefix.'member AS B ON A.member=B.id';
    	if(!isset($params['select'])){
    		$params['select']='A.id,B.mail,A.sort,A.title,A.date,A.ip,A.sequence,A.locked';
    	}
    	return $this->db->select($table,$params);
    }
	public function IContent($params,$mode=0){
		return $this->db->insert($this->prefix.'content',$params,$mode);
	}
	public function UContent($params){
		return $this->db->update($this->prefix.'content',$params);
	}
	public function DContent($params){
		return $this->db->delete($this->prefix.'content',$params);
	}
}
?>